<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .active{
            color:red;
        }
    </style>
</head>
<body>
    <ul>

    </ul>
    <script>
        let shu=['aaa','bbb','ccc']
        let obj=shu.map(function(item,index){
            return a=`<li class="${index===0?'active':''}"><b>${item+'  '+test()}</b></li>`
        })
        console.log(obj)
        let hou=document.querySelector("ul")
        hou.innerHTML=obj.join('')
        function test(){
            return 'sss'
            // console.log('成功')
        }
    </script>
</body>
</html>